package gs.wicket.app.admin;
import java.util.ArrayList;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.Model;

import gs.wicket.app.account.Korisnik;
import gs.wicket.app.account.Korisnici;
import gs.wicket.app.base.BasePage;

public class AdminPage extends BasePage {
	
	
	public AdminPage(){
		
		add(new Label("korisnici", getLangProperty("admin.page.users")));
		
		ArrayList<Korisnik> korisnici = Korisnici.getKnownKorisnici().getKorisnici();
		String ispis = "";
		for (Korisnik k :korisnici){
			if(k.getUsername()=="admin")
				continue;
			else
			{
			ispis += getLangProperty("register.page.username")+" "+k.getUsername()+"\n\n"+
					 getLangProperty("register.page.name")+" "+k.getIme()+"\n" +
					 getLangProperty("register.page.street")+" "+k.getUlica()+"\n" +
					 getLangProperty("register.page.city")+" "+k.getPostanskiBroj()+" "+k.getGrad()+"\n" +
					 "--------------------------"+"\n\n";
			}	
		}
		
		add(new TextArea("popis",new Model(ispis)));
		
		
	}

}
